package com.goodving.guli.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.goodving.guli.R;

/**
 * Created by john on 2015/11/25.
 */
public class C3247b extends Toast {
    public C3247b(Context context) {
        super(context);
    }

    public static Toast m22928a(Context context, int i, int i2) {
        return context == null ? null : C3247b.m22929a(context, i, i2, 3);
    }

    public static Toast m22929a(Context context, int i, int i2, int i3) {
        return context == null ? null : C3247b.m22931a(context, context.getResources().getString(i), i2, i3);
    }

    public static Toast m22930a(Context context, String str, int i) {
        return C3247b.m22931a(context, str, i, 3);
    }

    public static Toast m22931a(Context context, String str, int i, int i2) {
        if (context == null) {
            return null;
        }
        Toast c3247b = new C3247b(context);
        ViewGroup viewGroup = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.custom_toast, null);
        TextView textView = (TextView) viewGroup.getChildAt(0);
        textView.setText(str);
        textView.setGravity(i2);
        c3247b.setView(viewGroup);
        c3247b.setDuration(i);
        return c3247b;
    }
}

